// Автосаджест городов
$('.order-add, .order-edit, .city-page, .route-page, .fo-page').livequery(function() {
	$( ".city-field" ).autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: W_AJAX + 'city/get',
						dataType: "jsonp",
						type : 'POST',
						data: {
							nameStartWith: request.term
						},
						success: function( data ) {
							response( $.map( data.citiesNames, function( item ) {
								return {
									label: item.city_name,
									value: item.city_name,
									id: item.ID_city
								}
							}));
						}
			});
		},
		minLength: 2,
		select: function( event, ui ) {
			$(this).parent().next().val(ui.item.id);
		},
		change: function( event, ui ) {
		}
	});
});